import wx

#app = wx.App()
#frame = wx.Frame(None,-1,'test',size=(500,100), pos=(300,400), style = wx.CLOSE_BOX | wx.CAPTION)
#frame.Show(True)
#class Size(wx.Frame):
 #   def __init__(self,parent,id,title):
  #      wx.Frame.__init__(self,parent,id,title,size=(800,600),style =  wx.RESIZE_BORDER | wx.CAPTION | wx.CLOSE_BOX)
   #     self.Center()
    #    self.Show(True)
#app = wx.App()
#Size(None,-1,'Size')

class LeftPanel(wx.Panel):
    def __init__(self,parent,id):
        wx.Panel.__init__(self,parent,id,style = wx.BORDER_SIMPLE)
        
        self.result = parent.GetParent().rightPanel.result
        self.one = parent.GetParent().rightPanel.txtOne
        
        self.two = parent.GetParent().rightPanel.txtTwo
         

        button1 = wx.Button(self,-1,'+',(10,10))
        button2 = wx.Button(self,-1,'-',(10,45))
        
        self.Bind(wx.EVT_BUTTON, self.Plus, id = button1.GetId())
        self.Bind(wx.EVT_BUTTON, self.Minus, id = button2.GetId())
        
    def Plus(self,event):
        valueOne = int(self.one.GetValue())
        valueTwo = int(self.two.GetValue())
        value = valueOne + valueTwo
        self.result.SetLabel(str(value))
        
    def Minus(self,event):
        valueOne = int(self.one.GetValue())
        valueTwo = int(self.two.GetValue())
        value = valueOne - valueTwo
        self.result.SetLabel(str(value))
        
class RightPanel(wx.Panel):
    def __init__(self,parent,id):
        wx.Panel.__init__(self,parent,id,style = wx.BORDER_SIMPLE)
        self.result = wx.StaticText(self,-1,'0', (50,50))
        
        self.txtOne = wx.TextCtrl(self,-1,'0',(50,100))
        self.txtTwo = wx.TextCtrl(self,-1,'0',(50,150))
        
class Calculate(wx.Frame):
    def __init__(self,parent,id,title):
        wx.Frame.__init__(self,parent,id,title)
        self.Size = (500,500)
        
        panel = wx.Panel(self,-1)
        self.rightPanel = RightPanel(panel,-1)
        
        leftPanel = LeftPanel(panel,-1)
        
        hbox = wx.BoxSizer()
        hbox.Add(leftPanel,1,wx.EXPAND | wx.ALL, 5)
        hbox.Add(self.rightPanel,1,wx.EXPAND | wx.ALL, 5)

        panel.SetSizer(hbox)
        self.Center()
        self.Show(True)
        
app = wx.App()
Calculate(None,-1,'Ugly calculator')
app.MainLoop()